﻿namespace Unikado.PHPLibs.Tokenizer.Types
{

    /// <summary>
    /// The TypeNormal is a part of a three-stage categorization of a PHP file token.
    /// Its the medium outlined/detailed type. (medium details)
    /// <code>
    /// TypeRough (Very rough outline)
    ///  + TypeNormal (A medium outline)
    ///     + TypeFine (This is the finest outline)
    /// </code>
    /// </summary>
    public enum TypeNormal
    {

        #region TypeRough.None

        /// <summary>
        /// The token contains no PHP code.
        /// </summary>
        None,

        #endregion

        #region TypeRough.PhpTag

        /// <summary>
        /// A opening or closing PHP Tag (All notations are supported)
        /// </summary>
        PhpTag,

        #endregion

        #region TypeRough.Whitespace

        /// <summary>
        /// The new line character <b>\n</b>. (<c>\r\n</c> dont exists! Its always replaced with <c>\n</c>)
        /// </summary>
        Space,
        /// <summary>
        /// The token is defined by one new line <c>\n</c>.
        /// </summary>
        NewLine,

        #endregion

        #region TypeRough.Comment

        /// <summary>
        /// The token is a comment (docblocks are excluded, see <see cref="Docblock"/>)
        /// </summary>
        Comment,
        /// <summary>
        /// All DocBlock comments.
        /// </summary>
        Docblock,

        #endregion

        #region TypeRough.KeywordSignature

        /// <summary>
        /// The 3 visibility keywords <b>public</b>, <b>protected</b> and <b>private</b>
        /// </summary>
        Visibility, // public, protected, private
        /// <summary>
        /// The PHP signature indentifier keywords: <b>class</b>, <b>const</b>, <b>define</b>, <b>interface</b>, <b>namespace</b>,
        /// <b>trait</b>, <b>function</b>, <b>use</b> and <b>var</b>
        /// </summary>
        SignatureIdentifier, // class, const, define, interface, namespace, trait, function, use, var
        /// <summary>
        /// The inheritance keywords <b>extends</b> and <b>implements</b>
        /// </summary>
        Inheritance, // extends, implements
        /// <summary>
        /// The keywords <b>abstract</b>, <b>final</b> and <b>static</b>.
        /// </summary>
        PrefixKeyword, // abstract, final, static

        #endregion

        #region TypeRough.Keyword

        /// <summary>
        /// Keywords for handling/throwing exceptions: <b>catch</b>, <b>throw</b>, <b>try</b>, <b>finally</b>
        /// </summary>
        ExceptionHandling, // catch, throw, try, finally
        /// <summary>
        /// The keywords for outputing some things <b>echo</b>, <b>print</b>
        /// </summary>
        Output, // echo, print
        /// <summary>
        /// The debug output "keywords" <b>var_dump</b> and <b>print_r</b>
        /// </summary>
        DebugOutput, // var_dump, print_r
        /// <summary>
        /// The keywords <b>die</b> and <b>exit</b>
        /// </summary>
        Exit, // die, exit
        /// <summary>
        /// Keywords usable as values: <b>true</b>, <b>false</b>, <b>array</b> and <b>null</b>.
        /// </summary>
        ValueKeyword, // true, false, array, null
        /// <summary>
        /// The keywords <b>eval</b> and <b>global</b>.
        /// </summary>
        BadCodeKeyword, // eval, glob
        /// <summary>
        /// All Control structure keywords: <b>if</b>, <b>else</b>, <b>elseif</b>, <b>for</b>, <b>foreach</b>, <b>while</b>,
        /// <b>do</b>, <b>switch</b>, <b>declare</b>, <b>case</b>, <b>goto</b>
        /// </summary>
        ControlStructure, // if, else, elseif, for, foreach, while, do, switch, declare, case, goto
        /// <summary>
        /// Keywords for use inside control structures: <b>as</b>, <b>break</b>, <b>continue</b>, <b>default</b>, <b>return</b>, <b>yield</b>
        /// </summary>
        ControlStructureInternal, // as, break, continue, default, return, yield
        /// <summary>
        /// All alternating Control structure keywords: <b>endif</b>, <b>endfor</b>, <b>endforeach</b>, <b>endswitch</b>
        /// and <b>enddeclare</b>.
        /// </summary>
        ControlStructureAlt, // endif, endfor, endforeach, endswitch, enddeclare
        /// <summary>
        /// The 3 special meaning classes <b>self</b>, <b>static</b> and <b>parent</b>
        /// </summary>
        SpecialClasses, // self, static, parent
        /// <summary>
        /// All other Keywords: <b>__halt_compiler</b>, <b>clone</b>, <b>callable</b>, <b>empty</b>, <b>instanceof</b>, <b>insteadof</b>,
        /// <b>isset</b>, <b>list</b>, <b>new</b> and <b>unset</b>
        /// </summary>
        OtherKeyword, // __halt_compiler, clone, callable, empty, instanceof, insteadof, isset, list, new, unset

        #endregion

        #region TypeRough.Operator

        /// <summary>
        /// A comparison operator: <c>!==</c>, <c>===</c>, <c>!=</c>, <c>==</c>, <c>&lt;&gt;</c>, <c>&lt;=</c>,
        /// <c>&gt;=</c>, <c>&lt;</c>, <c>&gt;</c>
        /// </summary>
        ComparisonOperator, // !== === != == <> <= >= < >
        /// <summary>
        /// A assignment operator: <c>&gt;&gt;=</c>, <c>&lt;&lt;=</c>, <c>^=</c>, <c>|=</c>, <c>&amp;=</c>,
        /// <c>.=</c>, <c>+=</c>, <c>-=</c>, <c>*=</c>, <c>/=</c>, <c>%=</c>, <c>=</c>, <c>.</c>, <c>=&gt;</c>
        /// </summary>
        AssignmentOperator, // >>= <<= ^= |= &= .= += -= *= /= %= = . =>
        /// <summary>
        /// A scope operator: <c>-&gt;</c>, <c>::</c>
        /// </summary>
        ScopeOperator, // -> ::
        /// <summary>
        /// A bitwise operator: <c>&lt;&lt;</c>, <c>&gt;&gt;</c>, <c>&amp;</c>, <c>|</c>, <c>^</c>, <c>~</c>
        /// </summary>
        BitwiseOperator, // << >> & | ^ xor ~
        /// <summary>
        /// Increment or decrement operator <c>++</c>, <c>--</c>
        /// </summary>
        XCrementOperator, // ++ --
        /// <summary>
        /// The logical operators: <c>and</c>, <c>or</c>, <c>xor</c>, <c>&amp;&amp;</c>, <c>||</c>, <c>!</c>, <c>?</c>, <c>:</c>
        /// </summary>
        LogicalOperator, // and or && || ! ? :
        /// <summary>
        /// A aritmethic operator: <b>+</b> <b>-</b> <b>*</b> <b>/</b> <b>%</b>
        /// </summary>
        AritmethicOperator, // + - * / %
        /// <summary>
        /// All other operators: <b>;</b>, <b>,</b>, <b>@</b>
        /// </summary>
        OtherOperator,

        #endregion

        #region TypeRough.String

        /// <summary>
        /// A string, defined in single or double quotes.
        /// </summary>
        String,
        /// <summary>
        /// A HEREDOC or NOWDOC string definition.
        /// </summary>
        HereNowDoc,
        /// <summary>
        /// A command string defined within backtick operators.
        /// </summary>
        Command,

        #endregion

        #region TypeRough.Predefined

        /// <summary>
        /// A predefined PHP variable (Superglobals also)
        /// </summary>
        VariablePredefined,
        /// <summary>
        /// A predefined PHP constant (magical constants also)
        /// </summary>
        ConstantPredefined,
        /// <summary>
        /// A predefined PHP function, class or interface name
        /// </summary>
        OtherPredefined,

        #endregion

        #region TypeRough.Bracket

        /// <summary>
        /// A opening bracket <b>{</b>, <b>[</b>, <b>(</b>
        /// </summary>
        OpenBracket,
        /// <summary>
        /// A closing bracket <b>}</b>, <b>]</b>, <b>)</b>
        /// </summary>
        CloseBracket,

        #endregion

        #region TypeRough.Include

        /// <summary>
        /// A file include: <b>include</b> and <b>include_once</b>
        /// </summary>
        Include,
        /// <summary>
        /// A file require: <b>require</b> and <b>require_once</b>
        /// </summary>
        Require,

        #endregion

        #region TypeRough.Number

        /// <summary>
        /// A floating point number
        /// </summary>
        Float,
        /// <summary>
        /// A integer number
        /// </summary>
        Integer,

        #endregion

        #region TypeRough.Other

        /// <summary>
        /// A PHP variable name (e.g.: <c>$variable</c>, includes no superglobals and predefined PHP variables)
        /// </summary>
        Variable,
        /// <summary>
        /// Some other unspecified PHP words.
        /// </summary>
        Word,
        /// <summary>
        /// All other stuff (This should never happen!)
        /// </summary>
        Other

        #endregion

    }

}